﻿using System;
using System.Web.Http;

namespace Flagwind.Web.Http
{
	public class HttpControllerBase : System.Web.Http.ApiController
	{
		#region 成员字段

		private Flagwind.Services.IServiceProvider _serviceProvider;

		#endregion

		#region 保护属性

		protected Flagwind.Services.IServiceProvider ServiceProvider
		{
			get
			{
				return _serviceProvider;
			}
			set
			{
				if(value == null)
					throw new ArgumentNullException();

				_serviceProvider = value;
			}
		}

		#endregion

		#region 构造方法

		protected HttpControllerBase(Flagwind.Services.IServiceProvider serviceProvider)
		{
			if(serviceProvider == null)
				throw new ArgumentNullException("serviceProvider");

			_serviceProvider = serviceProvider;
		}

		#endregion
	}
}
